package cn.iocoder.yudao.module.system.repository.mybatis.dao.mail;

import cn.iocoder.yudao.common.pojo.PageResult;
import cn.iocoder.yudao.core.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.core.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.repository.mybatis.domain.mail.MailAccount;
import cn.iocoder.yudao.module.system.vo.mail.account.MailAccountPageReqVO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface MailAccountMapper extends BaseMapperX<MailAccount> {

    default PageResult<MailAccount> selectPage(MailAccountPageReqVO pageReqVO) {
        return selectPage(pageReqVO, new LambdaQueryWrapperX<MailAccount>()
                .likeIfPresent(MailAccount::getMail, pageReqVO.getMail())
                .likeIfPresent(MailAccount::getUsername, pageReqVO.getUsername()));
    }

}
